package mortal.game.net.rmi.login
{
	import Message.Login.*;
	import mortal.common.net.*;
	import mortal.game.net.*;
	
	public class LoginRMI extends RMIBase
	{
		public var loginProxy:ILoginPrxHelper;
		private static var _instance:LoginRMI;
		
		public function LoginRMI()
		{
			this.loginProxy = new ILoginPrxHelper();
			if (_instance != null)
			{
				throw new Error("CreateRoleRMI 单例");
			}
		}
		
		override public function set rmiSession(session:RMISession) : void
		{
			session.session.messageHandler = new LoginMessageHandler();
			super.rmiSession = session;
		}
		
		override protected function initProxy() : void
		{
			session.registerProxy(this.loginProxy);
		}
		
		public static function get instance() : LoginRMI
		{
			if (_instance == null)
			{
				_instance = new LoginRMI;
			}
			return _instance;
		}
	}
}
